﻿<phone:PhoneApplicationPage 
    x:Class="Notes.DetailPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
	shell:SystemTray.Opacity="0.8"
    shell:SystemTray.IsVisible="True"
    OrientationChanged="PhoneApplicationPage_OrientationChanged">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,32,0,72" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,12,32">
			<TextBlock x:Name="ApplicationTitle" Text="{Binding Path=LocalizedResources.strTitleApp, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding Note.Title}" TextWrapping="Wrap" Margin="12,-7,12,5" Style="{StaticResource PhoneTextTitle1Style}" />
        </StackPanel>

        <ScrollViewer Grid.Row="1">
            <TextBlock x:Name="ContentText" Text="{Binding Note.Text}" TextWrapping="Wrap" Margin="24,0"/>
        </ScrollViewer>

        <ListBox ItemsSource="{Binding Photos}" Grid.Row="3" x:Name="ImagesListBox" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Disabled" SelectionChanged="ImagesListBox_SelectionChanged" Margin="0,10,0,0">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Width="90" Height="90" Margin="10">
                        <StackPanel.Background>
                            <ImageBrush ImageSource="{Binding Bitmap}" Stretch="UniformToFill" />
                        </StackPanel.Background>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>


    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Opacity="0.8">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.edit.rest.png" Click="ApplicationBarEdit_Click" Text="Edit"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.delete.rest.png" Click="ApplicationBarDel_Click" Text="Delete"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>


</phone:PhoneApplicationPage>
